<template>
  <div>
      <h1>列表</h1>
      <ul>
          <li :class="{active:item.statuse==='finished'}" v-for="item in data" :key="item.id">{{item.content}}<button v-if="item.statuse==='todo'" @click="change(item.id)">完成</button></li>
      </ul>
  </div>
</template>

<script>
export default {
    props:{
        data:Array
    },
    methods: {
        change(id){
            this.$emit('modify',id)
        }
    },
}
</script>

<style scoped>
.active{
    text-decoration: line-through;
}
</style>